/*
 * @Author: your name
 * @Date: 2021-04-02 18:19:04
 * @LastEditTime: 2021-04-13 12:38:09
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \inventory-apie:\hjimi\人脸辨识云\html\visitorOrder\api\user.js
 */
import request from '../commom/js/request.js';
import Vue from 'vue'; //引入vue
 let vm = new Vue();

export function imageUpload() {
	return new Promise(function(resolve){
		if(vm.BASEURL) {
			return resolve(`${ vm.BASEURL }file/upload`)
		}
	})
}
/**
 * @description: 
 * @param {code, phone}
 */
export function visitorSubmit(data){
	return request({
	    url: 'visitor/',
		method: 'POST',
		data: data,
	 })
    }
	
// 获取二维码
export function getQr(data){
	return request({
	    url: 'qr/getQr',
		method: 'POST',
		data: data
	 })
    }
	
// 刷新二维码
export function getQrs(data){
	return request({
	    url: `qr/generator-qrcode/${ data }`,
		method: 'POST'
	 })
    }

// 查看预约信息
export function searchVisitorMsg(params){
	return request({
	    url: `visitor/`,
		method: 'GET',
		data: params
	 })
    }
	
// 删除预约单
export function deleteVisitorMsg(id) {
	return request({
	    url: `visitor/${ id }`,
		method: 'DELETE',
	 })
}
// 修改预约单
export function editVisitorMsg(id, data) {
	return request({
	    url: `visitor/${ id }`,
		method: 'POST',
		data: data
	 })
}

// 查看通行记录
export function showAccessRecords(data) {
	return request({
	    url: 'access/showAccessRecords',
		method: 'GET',
		data:data
	 })
}

export { imageUpload as getImageUpLoad }